home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
turbotut.arc
/
READSTOR.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-06-30
|
790b
|
32 lines
PROGRAM read_and_store_a_file;
VAR read_file : TEXT;
input_file_name : STRING[12];
write_file : TEXT;
output_file_name : STRING[12];
line_number : INTEGER;
big_string : STRING[80];
BEGIN
WRITE('Enter input file name ');
READLN(input_file_name);
ASSIGN(read_file,input_file_name);
RESET(read_file);
WRITE('Enter output file name ');
READLN(output_file_name);
ASSIGN(write_file,output_file_name);
REWRITE(write_file);
line_number := 1;
WHILE NOT eof(read_file) DO
BEGIN
READLN(read_file,big_string);
WRITE(write_file,line_number:5,' ');
WRITELN(write_file,big_string);
line_number := line_number + 1;
END;
CLOSE(read_file);
CLOSE(write_file);
END. (* of program *)